package models

import "sync"

type HelloReq struct {
	Name string `form:"name" binding:"required"`
}

type HelloResp struct {
	Reply string `json:"reply"`
}

type ListResp struct {
	List interface{} `json:"list"`
}

type SignInReq struct {
	UserId int `form:"user_id" json:"user_id" binding:"required"`
}

type SignInResp struct {
	Reply string `json:"reply"`
}

type CheckInReq struct {
	UserId int `form:"user_id" json:"user_id" binding:"required"`
}

type CheckInResp struct {
	CheckIn interface{} `json:"check_in"`
	UserId  int
}

type CheckInReq2 struct {
	UserId int    `form:"user_id" json:"user_id" binding:"required"`
	Date   string `form:"date" json:"date" binding:"required"`
}
type CheckInResp2 struct {
	CheckIn bool `json:"check_in"`
}

type CheckInReq3 struct {
	UserId int    ` json:"user_id" binding:"required"`
	Date   string ` json:"date" binding:"required"`
}
type CheckInResp3 struct {
	CheckIn int64 `json:"check_in"`
}

type SignInReq3 struct {
	UserId int    `form:"user_id" json:"user_id" binding:"required"`
	Date   string ` json:"date" binding:"required"`
}

type SignInResp3 struct {
	Reply string `json:"reply"`
}

type BitCount struct {
	Start int64
	End   int64
}

type CheckInTotalNumReq struct {
	UserId int      `form:"user_id" json:"user_id" binding:"required"`
	BitC   BitCount `form:"bit" json:"bit" binding:"required"`
}

type CheckInTotalNumResp struct {
	Reply int64 `json:"reply"`
}

type User struct {
	ID       uint `gorm:"primarykey; AUTO_INCREMENT"`
	Name     string
	Password string
}

type LoginRequestReq struct {
	Name     string `json:"name" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type LoginRequestResp struct {
	Reply string `json:"reply"`
}

type RegisterRequestReq struct {
	Name     string `json:"name" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type RegisterRequestResp struct {
	Reply string `json:"reply"`
}

type Handler struct {
	Mu               sync.Mutex
	FailedLoginCount map[string]int
}

type AvatarUploadReq struct {
	Name string `form:"name" binding:"required"`
}

type AvatarUploadResp struct {
	Reply string `json:"reply"`
	URL   string `json:"url,omitempty"`
}
